#circles example
from math import pi, sqrt

def draw_circle( x, r, level ):
    global CNTX, H
    CNTX.arc( x, H/2, r, 0, 2*pi)
    CNTX.stroke() 
    if level > 1:
        level = level - 1
#        print "%d %d %d" % ( x, r, level)
        draw_circle( x - r/2, r/2, level )
        draw_circle( x + r/2, r/2, level )

CNTX.set_source_rgb(0, 0, 0)
draw_circle( W/2, W/2, 6 )
